﻿using System;
using System.Collections.Generic;
using System.IO;

using WebDavProcessor.Constants;

namespace WebDavProcessor.Resources
{
    public class WebDavStreamResource : WebDavResourceProperties
    {
        private Stream resourceData;

        public Stream Data { get { return resourceData; } set { resourceData = value; } }

        public object GetContentLanguage { get { return this.FindProperty(WebDavPropertyNames.GetContentLanguage); } }
        public object GetContentLength { get { return this.FindProperty(WebDavPropertyNames.GetContentLength); } }
        public object GetContentType { get { return this.FindProperty(WebDavPropertyNames.GetContentType); } }
        public object GetETag { get { return this.FindProperty(WebDavPropertyNames.GetETag); } }
        public object GetLastModified { get { return this.FindProperty(WebDavPropertyNames.GetLastModified); } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="path"></param>
        /// <param name="status"></param>
        /// <param name="data"></param>
        public WebDavStreamResource(string path, int status, Stream data)
            : base(path, status)
        {
            resourceData = data;
        }
        public WebDavStreamResource(string path, int status)
            : base(path, status)
        {
        }
        /// <summary>
        /// Successfull operation. Status code is 200.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="data"></param>
        public WebDavStreamResource(string path, Stream data)
            : base(path)
        {
            resourceData = data;
        }
        public WebDavStreamResource(string path)
            : base(path)
        {
        }
    }
}
